var app = angular.module('crawlerApp');
app.config(['$locationProvider', '$stateProvider', '$urlRouterProvider',
    function($locationProvider, $stateProvider, $urlRouterProvider) {
      // $locationProvider.html5Mode({
      //   enabled: true,
      //   requireBase: false
      // });
      $urlRouterProvider.otherwise('/start');
      $stateProvider.state('start', {
        url: '/start',
        templateUrl: 'src/app/tmpl/index.html'
      });
      $stateProvider.state('task', {
        url: '/task',
        templateUrl: 'src/task/tmpl/task.html'
      });
      $stateProvider.state('group', {
        url: '/group/:id',
        templateUrl: 'src/group/tmpl/group.html'
      });
      $stateProvider.state('project', {
        url: '/project/:id',
        templateUrl: 'src/project/tmpl/project.html'
      });
      $stateProvider.state('set', {
        url: '/set/:id',
        templateUrl: 'src/set/tmpl/set.html'
      });
    }
  ])
  .config(['toastrConfig', function(toastrConfig) {
    angular.extend(toastrConfig, {
      autoDismiss: true,
      // maxOpened: 1500,
      timeOut: 2000,
      closeButton: true
    });
  }])
  .config(['$qProvider', function ($qProvider) {
    $qProvider.errorOnUnhandledRejections(false);
}]);;
